<%@page import="models.NewsModel"%>
<%@page import="helpers.UrlHelper"%>
<%@page import="java.util.ArrayList"%>
<%@ page contentType="text/xml;charset=UTF-8" language="java"%>
<?xml version="1.0" encoding="UTF-8"?>
<% 
String serverUrl = UrlHelper.getServerUrl(request);
ArrayList<NewsModel> lst_news = (ArrayList<NewsModel> )request.getAttribute("lst_news");
%>
<urlset
      xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
            http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
  <url>
  <loc><%=serverUrl %>/</loc>
</url>
<%
for(NewsModel news : lst_news)
{
%>
<url>
  <loc><%=serverUrl %>/view/<%=news.getId()%>/<%=news.getAlias()%></loc>
</url>
<%
}
%>
</urlset>